import request from '@/utils/request'
import axios from 'axios'

// ============== 约拍套餐 =================

// 获取约拍套餐数据
export function mealShootList(query) {
    return request({
        url: '/system/mealShoot/list',
        method: 'get',
        params: query
    })
}

// 新增约拍套餐
export function addMealShoot(data) {
    return request({
        url: '/system/mealShoot',
        method: 'post',
        data: data
    })
}
// 获取约拍套餐详情
export function detailMealShoot(id) {
    return request({
        url: '/system/mealShoot/' + id,
        method: 'get'
    })
}

// 修改约拍套餐信息
export function updateMealShoot(data) {
    return request({
        url: `/system/mealShoot`,
        method: 'put',
        data: data
    })
}

// 删除约拍套餐
export function deleteMealShoot(id) {
    return request({
        url: '/system/mealShoot/' + id,
        method: 'delete'
    })
}

// ============== 约拍列表 =================

// 约拍列表数据
export function shootList(query) {
    return request({
        url: '/system/shoot/list',
        method: 'get',
        params: query
    })
}

// 获取约拍列表详情
export function detailShoot(id) {
    return request({
        url: '/system/shoot/' + id,
        method: 'get'
    })
}

// 删除约拍列表
export function deleteShoot(id) {
    return request({
        url: '/system/shoot/' + id,
        method: 'delete'
    })
}

// 分配摄影师
export function assignCameraman(orderShootId, cameramanId, params) {
    return request({
        url: '/system/shoot/assignCameraman/' + orderShootId + '/' + cameramanId,
        method: 'get',
        params: params
    })
}

// 上传素材文件(阿里云oss)
export function updateMediaFile(data) {
    return request({
        url: '/system/shoot/updateMediaFile',
        method: 'post',
        data: data
    })
}

// 获取媒资信息GetMediaInfo
export function getMediaInfoi(params) {
    axios.defaults.baseURL = '/skiingvideo-mock'
    return request({
        url: '/main',
        xf_url: '/skiingvideo-mock',
        method: 'GET',
        params
    })
}

// 上传素材信息
export function uploadMediaInfo(data) {
    return request({
        url: '/system/shoot/uploadMediaInfo',
        method: 'post',
        data: data
    })
}

// 设置尾款
export function setBalancePayment(orderShootId, data) {
    return request({
        url: '/system/shoot/setBalancePayment/' + orderShootId,
        method: 'post',
        params: data
    })
}

// 设置合成剪辑作业数量
export function setResidueEditNumber(orderShootId, query) {
    return request({
        url: '/system/shoot/setResidueEditNumber/' + orderShootId,
        method: 'GET',
        params: query
    })
}